set DESTDIR="."

If "%1" Neq "" (
	set DESTDIR=%1
)

del UserAndLoginControl.zip
set ERRORS=0

echo Create directory
rem rd %DESTDIR% /S /Q > nul
mkdir %DESTDIR%\Temp

xcopy DotNetNuke\DesktopModules\UserAndLoginControl\UserAndLoginControl.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=1
xcopy DotNetNuke\DesktopModules\UserAndLoginControl\UserAndLoginControl.dnn %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=2
xcopy DotNetNuke\DesktopModules\UserAndLoginControl\App_LocalResources\*.resx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=3
xcopy DotNetNuke\bin\Jfc007.WebLib.UserAndLoginControl.dll %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=4


"c:\Program Files\7-Zip\7z.exe" a -tzip %DESTDIR%\UserAndLoginControl.Zip %DESTDIR%\Temp\*.*
if not %ERRORLEVEL% == 0 set ERRORS=5

rmdir %DESTDIR%\Temp /s /q
if not %ERRORLEVEL% == 0 set ERRORS=6

if not %ERRORS% == 0 echo Errors occured

rem exit %ERRORS%

